home *** CD-ROM | disk | FTP | other *** search
- //****************************************************************//
- // Filename: WindowList.h
- // Autor: Christian Taulien of Strange Intelligence
- // Purpose: Testprogram for the SIFC
- // Creation: 17. Mai 1998
- //****************************************************************//
- #ifndef TAULIEN_WINDOWLIST_H
- #define TAULIEN_WINDOWLIST_H
-
- #include <exec/types.h>
- #include <exec/nodes.h>
- #include <exec/lists.h>
- #include <intuition/intuition.h>
-
- #include "SIFC_Strings.h"
- #include "Bar.h"
-
- class BarWindowListC;
-
- //*************************************************************************//
- //.klasse
- //KLASSENNAME : BarWindowNodeC
- //VERSION : 17. Mai 1998
- //AUTOR : Taulien
- //AUFGABE : Eine Klasse zur eines BalkenFensters (ProgressBarWindow)
- //DOKUMENTATION : -
- //BEMERKUNGEN : -
- //AENDERUNGEN : -
- //*************************************************************************//
- class BarWindowNodeC : public struct Node
- {
- friend class BarWindowListC;
- private:
- // ## datamembers ##
- BarListC m_oBarList;
- StringC m_oName;
- StringC m_oButtonText;
- StringC m_oScreenName;
- struct Screen *m_poLockedScreen;
- struct Window *m_poBarWindow;
- struct MsgPort *m_poSharedUserPort;
- struct Gadget *m_poFirstGadget;
- struct Gadget *m_poButton;
- BOOL m_bGadgetsAttached;
- BOOL m_bCloseGadget;
- int m_iWidth;
- int m_iHeight;
- int m_iTop;
- int m_iLeft;
- int m_iBorderTop;
- int m_iBorderRight;
- int m_iBorderLeft;
- int m_iBorderBottom;
- int m_iMaxVisibleEntries;
- ULONG m_ulBarWindowID;
-
- static ULONG m_ulNextFreeID;
-
- // ## methods
- struct Screen *lockScreen();
- void unlockScreen();
- struct Gadget *createGadgets();
- void freeGadgets();
- void clearBarWindow();
- void hideGadgets();
- void showGadgets();
- void validateWindowSize();
-
- BarWindowNodeC(BarWindowListC *arg_poBarList,
- char *arg_sName,
- char *arg_sButtonName,
- char *arg_sScreenName = "",
- BOOL arg_bCloseGadget=TRUE);
-
- public:
- // ## datamembers
-
- // ## methods
- ~BarWindowNodeC();
-
- BOOL openBarWindow();
- void closeBarWindow();
- void setBarWindowWidth(ULONG arg_ulWidth);
- void setBarWindowPos(int arg_iPosX, int arg_iPosY);
- void setBarWindowTitle(char *arg_sName);
- BOOL testOKButton();
-
- struct Window *getWindow() { return m_poBarWindow; }
-
- StringC getName(void) { return m_oName; }
- ULONG getBarWindowID() { return m_ulBarWindowID; }
-
- BarWindowNodeC *getNext(void);
- BarWindowNodeC *getPrev(void);
-
- BarNodeC *addBar(char *arg_sName, ULONG arg_ulMaxValue = 100);
- void removeBar(ULONG arg_ulBarID);
- BarNodeC *findBarNode(ULONG arg_ulBarID)
- { return m_oBarList.findBarNode(arg_ulBarID); }
-
- void refreshBars();
- BOOL isOpen() { return m_poBarWindow != NULL; }
- BOOL hasButton() { return !m_oButtonText.isEmpty(); }
- };
-
- //*************************************************************************//
- //.klasse
- //KLASSENNAME : BarWindowListC
- //VERSION : 17. Mai 1998
- //AUTOR : Taulien
- //AUFGABE : Eine Klasse für die Verwaltung verschiedener Balkenfenster
- //DOKUMENTATION : -
- //BEMERKUNGEN : -
- //AENDERUNGEN : -
- //*************************************************************************//
- class BarWindowListC : public struct List
- {
- struct MsgPort *m_poSharedUserPort;
- public:
- BarWindowListC();
- ~BarWindowListC();
-
- BarWindowNodeC *addBarWindow(char *arg_sName, char *arg_sButtonName,char *arg_sScreenName, BOOL arg_bCloseGadget);
- void removeBarWindow(ULONG arg_ulBarWindowID);
- void removeAll();
-
- BarWindowNodeC *findBarWindowNode(ULONG arg_ulBarWindowID);
- BarWindowNodeC *getFirst() { return (BarWindowNodeC *) lh_Head; }
- int indexOf(BarWindowNodeC *arg_poNode);
- int getSize();
- struct MsgPort *getSharedUserPort() { return m_poSharedUserPort; }
-
- BarWindowNodeC *operator[](int arg_iIndex);
- };
-
- #endif // TAULIEN_INDOWLIST_H
-
-
-